<template>
  <div class="log">
    <div class="head">
      <span>操作记录</span>
    </div>

    <el-table :data="tableData" height="720" border style="width: 100%">
      <el-table-column prop="time" label="时间" width="200">
      </el-table-column>
      <el-table-column prop="yxmc" label="院系名称" width="200">
      </el-table-column>
      <el-table-column prop="zymc" label="专业名称" width="200">
      </el-table-column>
      <el-table-column prop="xz" label="学制"> </el-table-column>
      <el-table-column prop="klmc" label="科类" width="200">
      </el-table-column>
      <el-table-column prop="zsrs" label="招生人数" width="160">
      </el-table-column>
      <el-table-column prop="jhlbmc" label="计划类别名称" width="200">
      </el-table-column>
      <el-table-column prop="czlx" label="类型" width="200">
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { request } from '../../network/request'
export default {
  name: '',
  data() {
    return {
      tableData: []
    }
  },
  methods: {},
  created() {
    request({
      url: 'http://118.31.51.131:8081/api/zsjh/ckjl',
      method: 'get',
      params: {
        token: sessionStorage.getItem("token")
      }
    }).then(value => {
      let arr = []
      let i = 0
      console.log(value);
      console.log(JSON.parse(value.data[0].cznr));
      for(let item of value.data) {
        this.tableData.push(JSON.parse(item.cznr))
        this.$set(this.tableData[i],'time',item.time)
        this.$set(this.tableData[i],'czlx',item.czlx)
        i++
      }
      // this.tableData = value.data
    })
  },
  beforeCreate() {
    if (sessionStorage.getItem("token") == null) {
      this.$router.push("/login");
    } else {
      let token = sessionStorage.getItem("token");
      let length = sessionStorage.getItem("token").length;
      if (token[length - 5] == "0") {
        this.$router.replace("/login");
      }
    }
  },
  components: {}
}
</script>

<style scoped>
.head {
  height: 80px;
  border-bottom: 1px solid black;
}
.head span {
  font-size: 20px;
  line-height: 80px;
  margin-left: 25px;
}
.log ::v-deep .el-table .cell {
  text-align: center;
}
</style>